# _*_ coding : utf-8 _*_
# @Time : 2024-05-29 12:59
# @Author : haowen
# @File : 8.人脸录入
# @Project : face identifying
import cv2

cap = cv2.VideoCapture(0)

# falg = 1
num = 1

while(cap.isOpened()):
    ret_flag,Vshow = cap.read()
    cv2.imshow("Capture_test",Vshow)
    k = cv2.waitKey(1) & 0xFF
    if(k == ord('s')):
        cv2.imwrite("cap_save_image/" + str(num) + ".name" + ".jpg",Vshow)
        print("sucess to save" + str(num) + ".jpg")
        print("--------------------")
        num += 1
    elif k == ord(' '):
        break

cap.release()
cv2.destroyAllWindows()